
package com.joysuch.wwyt.datadump.biz.query;

import cn.zlg.common.datadump.condition.QueryCondtionDef;
import cn.zlg.common.datadump.condition.QueryFieldCondition;
import cn.zlg.common.datadump.condition.SortFieldDef;
import com.joysuch.wwyt.bp.entity.investigate.dsl.QBpInvestigateStoreDetail;
import com.joysuch.wwyt.datadump.biz.condition.BpInvestigateStoreFindSubstoreConditionBuilder;
import com.joysuch.wwyt.util.ApplicationContextHolder;
import com.querydsl.core.types.Order;

public class BpInvestigateStoreDetailDumpQueryBean implements QueryCondtionDef {

    @Override
    public QueryFieldCondition[] getAllConditionDef() {
        QBpInvestigateStoreDetail q = QBpInvestigateStoreDetail.bpInvestigateStoreDetail;
        return new QueryFieldCondition[]{
                new QueryFieldCondition("ids", q, q.id, q.id, "in"),
                new QueryFieldCondition("storeId", q, q.id,
                        ApplicationContextHolder.getBean(BpInvestigateStoreFindSubstoreConditionBuilder.class), "eq"),
                new QueryFieldCondition("name", q, q.content, q.id, "contains"),};
    }

    @Override
    public SortFieldDef[] getAllSortFieldDef() {
        return new SortFieldDef[]{
                new SortFieldDef(QBpInvestigateStoreDetail.bpInvestigateStoreDetail.content, "content", Order.ASC)};
    }
}
